package socket;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int pw=22;
        int[] allOut={5,2,3,4,7,8,6,98,26,45,22,89,65};
        System.out.println(Arrays.toString(allOut));

        //将pw从allOut中删除

        for (int i=0;i<allOut.length;i++){
            if (allOut[i]==pw){
                allOut[i]=allOut[allOut.length-1];
                allOut=Arrays.copyOf(allOut,allOut.length-1);
                break;
            }
        }
        Arrays.sort(allOut);
        System.out.println(Arrays.toString(allOut));

    }
}
